package com.xwdeshj.tasks;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by BKWJA on 2019/1/30.
 * 定时任务类
 */
@Slf4j
@Component
public class AsynTask {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    /**
     * 每隔7天，删除用户升级为商家，已被拒绝的数据
     * http://www.pppet.net/
     */
    @Scheduled(cron = "0 0 0 1/7 * ? ") //每隔5分钟再执行
    public void delbussinessRefuse(){


        logger.info("定时任务 每隔7天，删除用户升级为商家，已被拒绝的数据---------------当前操作时间："+dateFormat.format(new Date()));
    }


}
